import request from '@/router/axios'
// 总仓列表接口

export const deptdepts = (query) => {
  return request({
    url: '/api/xmbz-order/warehouse/selectCity',
    // url: 'http://192.168.2.106:8107/warehouse/selectCity',
    method: 'get',
    params: query
  })
}
export const getWarehousePage = (query) => {
  return request({
    url: '/api/xmbz-order/warehouse/getWarehousePage',
    // url: 'http://192.168.2.106:8107/warehouse/getWarehousePage',
    method: 'get',
    params: query
  })
}

export const getWarehouseList = (query) => {
  return request({
    url: '/api/xmbz-order/warehouse/getWarehouseList',
    // url: 'http://192.168.2.106:8107/warehouse/getWarehouseList',
    method: 'get',
    params: query
  })
}
export const selectDeptByCityId = (query) => {
  return request({
    url: '/api/xmbz-order/warehouse/selectDeptByCityId',
    // url:'http://192.168.2.106:8107/warehouse/selectDeptByCityId',
    method: 'get',
    params: query
  })
}


export const getWarehouseName = (query) => {
  return request({
    url: '/api/xmbz-order/warehouse/getWarehouseName',
    // url:'http://192.168.2.106:8107/warehouse/getWarehouseName',
    method: 'get',
    params: query
  })
}
export const warehouseelete = (data) => {
  return request({
    url: '/api/xmbz-order/warehouse/delete',
    // url:'http://192.168.2.106:8107/warehouse/delete',
    method: 'post',
    data
  })
}

export const warehouseSave = (data) => {
  return request({
    url: '/api/xmbz-order/warehouse/save',
    // url:'http://192.168.2.106:8107/warehouse/save',
    method: 'post',
    data
  })
}
export const warehouseupdate = (data) => {
  return request({
    url: '/api/xmbz-order/warehouse/update',
    // url:'http://192.168.2.106:8107/warehouse/update',
    method: 'post',
    data
  })
}

export const getWarehouseLoadList = (query) => {
  return request({
    url: '/api/xmbz-order/warehouse/getWarehouseLoadList',
    // url:'http://192.168.2.106:8107/warehouse/getWarehouseLoadList',
    method: 'get',
     params: query
  })
}

export const addWarehouseLoad = (data) => {
  return request({
    url: '/api/xmbz-order/warehouse/addWarehouseLoad',
    // url:'http://192.168.2.106:8107/warehouse/addWarehouseLoad',
    method: 'post',
    data
  })
}
export const updateWarehouseLoad = (data) => {
  return request({
    url: '/api/xmbz-order/warehouse/updateWarehouseLoad',
    // url:'http://192.168.2.106:8107/warehouse/updateWarehouseLoad',
    method: 'post',
    data
  })
}
export const getWarehouseConfig = (query) => {
  return request({
    url: '/api/xmbz-order/warehouse/getWarehouseConfig',
    method: 'get',
    params: query
  })
}
export const updateWarehouseConfig = (data) => {
  return request({
    url: '/api/xmbz-order/warehouse/updateWarehouseConfig',
    // url:'http://192.168.2.106:8107/warehouse/updateWarehouseLoad',
    method: 'post',
    data
  })
}
export const warehousetype = (query) => { //仓库类型
  return request({
    url: '/api/xmbz-system/dict/dictionary?code=warehouse_type',
    method: 'get',
    params: query
  })
}
export const ProductionWarehouseByCity = (query) => { //仓库类型
  return request({
    url: '/api/xmbz-order/warehouse/getProductionWarehouseByCity',
    method: 'get',
    params: query
  })
}

export const getWarehouseByType = (query) =>{
  return request({
    url: '/api/xmbz-order/warehouse/getWarehouseList',
    method: 'get',
    params: query
  })
}

export const batchUpdateWarehouseDeliveryTime = (data) =>{
  return request({
    url: '/api/xmbz-order/warehouse/batchUpdateWarehouseDeliveryTime',
    method: 'post',
    data
  })
}

export const deliveryFee = (params) =>{
  return request({
    url: '/api/xmbz-warehouse/calculate/deliveryFee',
    method: 'get',
    params
  })
}
